.class public final Lcom/adwhirl/a/a;
.super Lcom/adwhirl/a/c;
.source "AdSenseAdapter.java"

# interfaces
.implements Lcom/google/ads/AdViewListener;


# instance fields
.field private h:Lcom/google/ads/GoogleAdView;


# direct methods
.method public constructor <init>(Lcom/adwhirl/AdWhirlLayout;Lcom/adwhirl/b/c;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 32
    invoke-direct {p0, p1, p2}, Lcom/adwhirl/a/c;-><init>(Lcom/adwhirl/AdWhirlLayout;Lcom/adwhirl/b/c;)V

    .line 33
    return-void
.end method

.method private static a(I)Ljava/lang/String;
    .locals 2
    .parameter

    .prologue
    .line 182
    if-ltz p0, :cond_0

    const/16 v0, 0xff

    if-le p0, v0, :cond_1

    .line 183
    :cond_0
    const/4 v0, 0x0

    .line 188
    :goto_0
    return-object v0

    .line 185
    :cond_1
    const/16 v0, 0xf

    if-gt p0, v0, :cond_2

    .line 186
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "0"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {p0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0

    .line 188
    :cond_2
    invoke-static {p0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method

.method private static a(III)Ljava/lang/String;
    .locals 4
    .parameter
    .parameter
    .parameter

    .prologue
    .line 171
    invoke-static {p0}, Lcom/adwhirl/a/a;->a(I)Ljava/lang/String;

    move-result-object v0

    .line 172
    invoke-static {p1}, Lcom/adwhirl/a/a;->a(I)Ljava/lang/String;

    move-result-object v1

    .line 173
    invoke-static {p2}, Lcom/adwhirl/a/a;->a(I)Ljava/lang/String;

    move-result-object v2

    .line 175
    if-eqz v0, :cond_0

    if-eqz v1, :cond_0

    if-nez v2, :cond_1

    .line 176
    :cond_0
    const/4 v0, 0x0

    .line 178
    :goto_0
    return-object v0

    :cond_1
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    goto :goto_0
.end method


# virtual methods
.method public final a()V
    .locals 8

    .prologue
    const/4 v7, 0x0

    const/4 v6, -0x2

    .line 38
    iget-object v0, p0, Lcom/adwhirl/a/a;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adwhirl/AdWhirlLayout;

    .line 40
    if-nez v0, :cond_0

    .line 124
    :goto_0
    return-void

    .line 44
    :cond_0
    iget-object v1, p0, Lcom/adwhirl/a/a;->b:Lcom/adwhirl/b/c;

    iget-object v1, v1, Lcom/adwhirl/b/c;->e:Ljava/lang/String;

    .line 46
    if-eqz v1, :cond_1

    const-string v2, "ca-mb-app-pub-"

    invoke-virtual {v1, v2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_2

    .line 48
    :cond_1
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->c()V

    goto :goto_0

    .line 52
    :cond_2
    sget-object v2, Lcom/adwhirl/a/a;->c:Ljava/lang/String;

    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_3

    sget-object v2, Lcom/adwhirl/a/a;->d:Ljava/lang/String;

    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_4

    .line 54
    :cond_3
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->c()V

    goto :goto_0

    .line 59
    :cond_4
    new-instance v2, Lcom/adwhirl/a/b;

    invoke-direct {v2, p0, v1}, Lcom/adwhirl/a/b;-><init>(Lcom/adwhirl/a/a;Ljava/lang/String;)V

    .line 60
    sget-object v1, Lcom/adwhirl/a/a;->c:Ljava/lang/String;

    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setCompanyName(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 61
    sget-object v1, Lcom/adwhirl/a/a;->d:Ljava/lang/String;

    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setAppName(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 62
    sget-object v1, Lcom/adwhirl/a/a;->e:Ljava/lang/String;

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_5

    .line 63
    sget-object v1, Lcom/adwhirl/a/a;->e:Ljava/lang/String;

    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setChannel(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 66
    :cond_5
    sget-object v1, Lcom/google/ads/AdSenseSpec$AdFormat;->FORMAT_320x50:Lcom/google/ads/AdSenseSpec$AdFormat;

    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setAdFormat(Lcom/google/ads/AdSenseSpec$AdFormat;)Lcom/google/ads/AdSenseSpec;

    .line 67
    invoke-static {}, Lcom/adwhirl/h;->a()Z

    move-result v1

    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setAdTestEnabled(Z)Lcom/google/ads/AdSenseSpec;

    .line 69
    new-instance v1, Lcom/google/ads/GoogleAdView;

    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->getContext()Landroid/content/Context;

    move-result-object v3

    invoke-direct {v1, v3}, Lcom/google/ads/GoogleAdView;-><init>(Landroid/content/Context;)V

    iput-object v1, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    .line 70
    iget-object v1, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    invoke-virtual {v1, p0}, Lcom/google/ads/GoogleAdView;->setAdViewListener(Lcom/google/ads/AdViewListener;)V

    .line 72
    iget-object v1, v0, Lcom/adwhirl/AdWhirlLayout;->d:Lcom/adwhirl/b/b;

    .line 73
    iget v3, v1, Lcom/adwhirl/b/b;->e:I

    iget v4, v1, Lcom/adwhirl/b/b;->f:I

    iget v5, v1, Lcom/adwhirl/b/b;->g:I

    invoke-static {v3, v4, v5}, Lcom/adwhirl/a/a;->a(III)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/adwhirl/a/b;->setColorBackground(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 74
    iget v3, v1, Lcom/adwhirl/b/b;->a:I

    iget v4, v1, Lcom/adwhirl/b/b;->b:I

    iget v5, v1, Lcom/adwhirl/b/b;->c:I

    invoke-static {v3, v4, v5}, Lcom/adwhirl/a/a;->a(III)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/adwhirl/a/b;->setColorText(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 75
    const-string v3, "A0A0A0"

    invoke-virtual {v2, v3}, Lcom/adwhirl/a/b;->setColorUrl(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 76
    iget v3, v1, Lcom/adwhirl/b/b;->e:I

    iget v4, v1, Lcom/adwhirl/b/b;->f:I

    iget v1, v1, Lcom/adwhirl/b/b;->g:I

    invoke-static {v3, v4, v1}, Lcom/adwhirl/a/a;->a(III)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setColorBorder(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 78
    invoke-static {}, Lcom/adwhirl/h;->c()Lcom/adwhirl/i;

    move-result-object v1

    .line 79
    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->a(Lcom/adwhirl/i;)V

    .line 81
    invoke-static {}, Lcom/adwhirl/h;->d()I

    move-result v1

    .line 82
    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->a(I)V

    .line 84
    invoke-static {}, Lcom/adwhirl/h;->f()Ljava/lang/String;

    move-result-object v1

    .line 85
    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v3

    if-nez v3, :cond_6

    .line 86
    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setKeywords(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 89
    :cond_6
    sget-object v1, Lcom/adwhirl/a/a;->g:Ljava/lang/String;

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_7

    .line 90
    sget-object v1, Lcom/adwhirl/a/a;->g:Ljava/lang/String;

    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setWebEquivalentUrl(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec;

    .line 94
    :cond_7
    const/4 v1, 0x1

    .line 95
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->getParent()Landroid/view/ViewParent;

    move-result-object v3

    .line 96
    if-nez v3, :cond_9

    move v1, v7

    .line 110
    :goto_1
    if-eqz v1, :cond_8

    sget-object v1, Lcom/adwhirl/a/a;->f:Ljava/lang/String;

    if-eqz v1, :cond_8

    .line 112
    :try_start_0
    sget-object v1, Lcom/adwhirl/a/a;->f:Ljava/lang/String;

    invoke-static {v1}, Lcom/google/ads/AdSenseSpec$ExpandDirection;->valueOf(Ljava/lang/String;)Lcom/google/ads/AdSenseSpec$ExpandDirection;

    move-result-object v1

    .line 113
    invoke-virtual {v2, v1}, Lcom/adwhirl/a/b;->setExpandDirection(Lcom/google/ads/AdSenseSpec$ExpandDirection;)Lcom/google/ads/AdSenseSpec;
    :try_end_0
    .catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0

    .line 120
    :cond_8
    :goto_2
    iget-object v1, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    const/4 v3, 0x4

    invoke-virtual {v1, v3}, Lcom/google/ads/GoogleAdView;->setVisibility(I)V

    .line 121
    iget-object v1, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    new-instance v3, Landroid/view/ViewGroup$LayoutParams;

    invoke-direct {v3, v6, v6}, Landroid/view/ViewGroup$LayoutParams;-><init>(II)V

    invoke-virtual {v0, v1, v3}, Lcom/adwhirl/AdWhirlLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 123
    iget-object v0, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    invoke-virtual {v0, v2}, Lcom/google/ads/GoogleAdView;->showAds(Lcom/google/ads/AdSpec;)V

    goto/16 :goto_0

    .line 102
    :cond_9
    instance-of v4, v3, Landroid/widget/ListView;

    if-nez v4, :cond_a

    instance-of v4, v3, Landroid/widget/ScrollView;

    if-eqz v4, :cond_b

    :cond_a
    move v1, v7

    .line 104
    goto :goto_1

    .line 106
    :cond_b
    invoke-interface {v3}, Landroid/view/ViewParent;->getParent()Landroid/view/ViewParent;

    move-result-object v3

    .line 107
    if-nez v3, :cond_9

    goto :goto_1

    :catch_0
    move-exception v1

    goto :goto_2
.end method

.method public final onAdFetchFailure()V
    .locals 2

    .prologue
    .line 155
    iget-object v0, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/google/ads/GoogleAdView;->setAdViewListener(Lcom/google/ads/AdViewListener;)V

    .line 158
    iget-object v0, p0, Lcom/adwhirl/a/a;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adwhirl/AdWhirlLayout;

    .line 159
    if-nez v0, :cond_0

    .line 165
    :goto_0
    return-void

    .line 163
    :cond_0
    iget-object v1, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    invoke-virtual {v0, v1}, Lcom/adwhirl/AdWhirlLayout;->removeView(Landroid/view/View;)V

    .line 164
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->c()V

    goto :goto_0
.end method

.method public final onClickAd()V
    .locals 0

    .prologue
    .line 151
    return-void
.end method

.method public final onFinishFetchAd()V
    .locals 4

    .prologue
    .line 135
    iget-object v0, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/google/ads/GoogleAdView;->setAdViewListener(Lcom/google/ads/AdViewListener;)V

    .line 138
    iget-object v0, p0, Lcom/adwhirl/a/a;->a:Ljava/lang/ref/WeakReference;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/adwhirl/AdWhirlLayout;

    .line 139
    if-nez v0, :cond_0

    .line 148
    :goto_0
    return-void

    .line 143
    :cond_0
    iget-object v1, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    invoke-virtual {v0, v1}, Lcom/adwhirl/AdWhirlLayout;->removeView(Landroid/view/View;)V

    .line 144
    iget-object v1, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lcom/google/ads/GoogleAdView;->setVisibility(I)V

    .line 145
    iget-object v1, v0, Lcom/adwhirl/AdWhirlLayout;->j:Lcom/adwhirl/g;

    invoke-virtual {v1}, Lcom/adwhirl/g;->d()V

    .line 146
    iget-object v1, v0, Lcom/adwhirl/AdWhirlLayout;->b:Landroid/os/Handler;

    new-instance v2, Lcom/adwhirl/f;

    iget-object v3, p0, Lcom/adwhirl/a/a;->h:Lcom/google/ads/GoogleAdView;

    invoke-direct {v2, v0, v3}, Lcom/adwhirl/f;-><init>(Lcom/adwhirl/AdWhirlLayout;Landroid/view/ViewGroup;)V

    invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 147
    invoke-virtual {v0}, Lcom/adwhirl/AdWhirlLayout;->b()V

    goto :goto_0
.end method

.method public final onStartFetchAd()V
    .locals 0

    .prologue
    .line 131
    return-void
.end method
